package com.rede.didiok.user.modulelist.rank.controller;

import java.util.concurrent.ExecutionException;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import com.rede.didiok.user.modulelist.rank.service.RankMemberService;
import com.rede.didiok.user.modulelist.rank.vo.RankMemberDetailVo;

/**
 * @Author: Rede
 * @DateTime: 2023-08-06 12:55
 * @Description: 榜单成员详情controller
 */
@Controller
public class MemberDetailController {

    @Resource
    private RankMemberService rankMemberService;

    /**
     * 展示当前榜单成员的详情
     * @param memberId
     * @return
     */
    @GetMapping("/{memberId}.html")
    public String memberDetail(@PathVariable("memberId") String memberUid, Model model) throws ExecutionException, InterruptedException {

        System.out.println("准备查询:" + memberUid + "的详情");
        RankMemberDetailVo memberDetailVo = rankMemberService.detail(memberUid);
        model.addAttribute("member",memberDetailVo);


        return "item.html";
    }
}
